import 'package:dio/dio.dart';
import '../../plugin/ts_plugin.dart';

class HttpResponseBodyInterceptor extends Interceptor {
  @override
  void onResponse(Response response, ResponseInterceptorHandler handler) async {
    if (response.data is String) {
      //解密
      var json = await TsPlugin.desDecrypt(response.data);
      response.data = json;
      handler.next(response);
    } else {
      super.onResponse(response, handler);
    }
  }
}
